<template>
  <view class="setting">
    <view class="setting-list">
      <view class="list flex flex-align flex-bt" @click="menuJump({is_tab: false,link: '/pages/setting/personalInfo',link_type: 1})">
        <view>个人信息</view>
        <uni-icons type="right" size="16" color="#333"></uni-icons>
      </view>
      <!-- <view class="list flex flex-align flex-bt" @click="menuJump({is_tab: false,link: '/pages/user/share',link_type: 1})">
        <view>分享好友</view>
        <uni-icons type="right" size="16" color="#333"></uni-icons>
      </view> -->
      <view class="list flex flex-align flex-bt" @click="menuJump({is_tab: false,link: '/pages/setting/about',link_type: 1})">
        <view>关于我们</view>
        <uni-icons type="right" size="16" color="#333"></uni-icons>
      </view>
      <view class="list flex flex-align flex-bt">
        <view>用户协议</view>
        <uni-icons type="right" size="16" color="#333"></uni-icons>
      </view>
      <view class="list flex flex-align flex-bt">
        <view>隐私政策</view>
        <uni-icons type="right" size="16" color="#333"></uni-icons>
      </view>
    </view>
    <view class="footer" @click="dialogToggle('info')">
      <view class="footer-text">
        退出登录
      </view>
    </view>
    <uni-popup ref="alertDialog" type="dialog">
				<uni-popup-dialog :type="msgType" cancelText="关闭" confirmText="确定" title="提示" content="确定退出登录？" @confirm="dialogConfirm"
					@close="dialogClose"></uni-popup-dialog>
			</uni-popup>
  </view>
</template>

<script lang="ts" setup>
import { goodStorage } from '@/utils';
import { menuJump } from '@/utils/tools';
import { ref } from 'vue';
import { useAuthStore } from '@/stores/counter'
const store=useAuthStore();
const alertDialog = ref()
const msgType = ref('info')
const dialogToggle = (type:any) => {
  msgType.value = type
  alertDialog.value.open()
}
const dialogConfirm = () => {
  console.log(1)
  goodStorage.remove('token')
  goodStorage.remove('dataUser')
  goodStorage.remove('routerInfo')
  goodStorage.remove('storeInfo')
  store.token=''
  store.dataUser={}
  store.routerInfo={}
  store.storeInfo={}
  uni.reLaunch({
    url: '/pages/login/login'
  })
}
const dialogClose = () => {
  console.log(2)
}

</script>

<style scoped lang="scss">
  .setting{
    padding: 30rpx;
    .setting-list{
      background: #fff;border-radius: 20rpx;padding: 0 20rpx;
    }
    .list{
      padding:30rpx 0 30rpx 20rpx;
      background: #fff;
      border-radius: 10rpx;
      border-bottom: 1px solid #F2F3F5;font-weight: bold;color: #323233;
    }
    .footer{
      position: fixed;width: 100%;bottom: 50rpx;left: 0;box-sizing: border-box;padding:0 30rpx;
      .footer-text{
        text-align: center;
        color: #323233;
        background: #fff;
        padding: 20rpx 0;
        font-weight: bold;border-radius: 60rpx;
      }
    }
  }
</style>